package com.example.demo;

import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @author junnan
 */
@SpringBootApplication
public class DemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

    @Value("${server.port}")
    private String port;

    @Bean
    CommandLineRunner init() {
        return args -> {
            System.out.println("***********【初始化启动成功】请访问：http://127.0.0.1:" + port);
        };
    }

    @GetMapping("/demo")
    @ApiOperation(value = "首页", hidden = true)
    public String demo() {
        return "demo";
    }

}
